home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_313 / uucp / uucp1.lzh / src / uucico / uuhosts.c < prev    next >
C/C++ Source or Header  |  1990-01-25  |  672b  |  39 lines

  1. /*
  2.    UUHOSTS  -- List all UUCP sites connected to our system
  3.  
  4.    Usage: UUHOSTS
  5.  
  6.    Copyright 1988 by William Loftus.  All rights reserved.
  7.  
  8.    ARPA: wpl@prc.unisys.com
  9.    UUCP: wpl@burdvax.UUCP
  10.    USMAIL: Unisys/Paoli Research Center;PO BOX 517;Paoli, PA 19301-0517
  11.  
  12. */
  13.  
  14. #include "/version.h"
  15. #include <stdio.h>
  16.  
  17. IDENT(".01");
  18.  
  19. void
  20. main()
  21. {
  22.     char buf[256];
  23.     FILE *fd;
  24.  
  25.     if (!(fd = fopen("UULIB:L.sys", "r"))) {
  26.     printf("Couldn't open UULIB:L.sys file\n");
  27.     exit(1);
  28.     }
  29.  
  30.     while (fgets(buf, sizeof buf, fd)) {
  31.     if (buf[0] == '#' || buf[0] == '\n')
  32.         continue;
  33.     buf[(int)strchr(buf,' ') - (int)buf] = '\0';
  34.     printf("%s\n", buf);
  35.     }
  36.     fclose(fd);
  37. }
  38.  
  39.